package o;

public class fza extends fzg implements Cloneable {
    static final /* synthetic */ boolean ॱॱ = (!fza.class.desiredAssertionStatus());
    public boolean ʻ;
    public boolean ˊ;
    public final fzp ˋ;
    public int ˎ;
    public fzp[] ˏ;
    public final fzp ॱ;
    private final fyy ᐝ;

    public /* synthetic */ Object clone() throws CloneNotSupportedException {
        return ˏ();
    }

    public fza() {
        super(fze.CHAIN);
        this.ˋ = new fzp();
        this.ॱ = new fzp();
        this.ˊ = false;
        this.ʻ = false;
        this.ᐝ = new fyy();
        this.ˏ = null;
        this.ʼ = fzo.ᐝॱ;
        this.ˎ = 0;
    }

    public int ˊ() {
        return this.ˎ - 1;
    }

    public void ˊ(fyy o_fyy, int i) {
        if (ॱॱ || (i >= 0 && i < this.ˎ - 1)) {
            o_fyy.ʼ = this.ʼ;
            fzp o_fzp = this.ˏ[i + 0];
            fzp o_fzp2 = this.ˏ[i + 1];
            o_fyy.ˋ.ˊ = o_fzp.ˊ;
            o_fyy.ˋ.ॱ = o_fzp.ॱ;
            o_fyy.ˊ.ˊ = o_fzp2.ˊ;
            o_fyy.ˊ.ॱ = o_fzp2.ॱ;
            if (i > 0) {
                o_fzp = this.ˏ[i - 1];
                o_fyy.ॱ.ˊ = o_fzp.ˊ;
                o_fyy.ॱ.ॱ = o_fzp.ॱ;
                o_fyy.ˎ = true;
            } else {
                o_fyy.ॱ.ˊ = this.ˋ.ˊ;
                o_fyy.ॱ.ॱ = this.ˋ.ॱ;
                o_fyy.ˎ = this.ˊ;
            }
            if (i < this.ˎ - 2) {
                o_fzp = this.ˏ[i + 2];
                o_fyy.ˏ.ˊ = o_fzp.ˊ;
                o_fyy.ˏ.ॱ = o_fzp.ॱ;
                o_fyy.ॱॱ = true;
                return;
            }
            o_fyy.ˏ.ˊ = this.ॱ.ˊ;
            o_fyy.ˏ.ॱ = this.ॱ.ॱ;
            o_fyy.ॱॱ = this.ʻ;
            return;
        }
        throw new AssertionError();
    }

    public void ˋ(fyg o_fyg, fzn o_fzn, int i) {
        if (ॱॱ || i < this.ˎ) {
            float f;
            fzp o_fzp = o_fyg.ˋ;
            fzp o_fzp2 = o_fyg.ॱ;
            int i2 = i + 1;
            if (i2 == this.ˎ) {
                i2 = 0;
            }
            fzp o_fzp3 = this.ˏ[i];
            fzp o_fzp4 = this.ˏ[i2];
            fzi o_fzi = o_fzn.ˏ;
            fzp o_fzp5 = o_fzn.ˊ;
            float f2 = ((o_fzi.ˊ * o_fzp3.ˊ) - (o_fzi.ˏ * o_fzp3.ॱ)) + o_fzp5.ˊ;
            float f3 = o_fzp5.ॱ + ((o_fzp3.ॱ * o_fzi.ˊ) + (o_fzi.ˏ * o_fzp3.ˊ));
            float f4 = ((o_fzi.ˊ * o_fzp4.ˊ) - (o_fzi.ˏ * o_fzp4.ॱ)) + o_fzp5.ˊ;
            float f5 = o_fzp5.ॱ + ((o_fzp4.ॱ * o_fzi.ˊ) + (o_fzi.ˏ * o_fzp4.ˊ));
            if (f2 < f4) {
                f = f2;
            } else {
                f = f4;
            }
            o_fzp.ˊ = f;
            if (f3 < f5) {
                f = f3;
            } else {
                f = f5;
            }
            o_fzp.ॱ = f;
            if (f2 <= f4) {
                f2 = f4;
            }
            o_fzp2.ˊ = f2;
            if (f3 <= f5) {
                f3 = f5;
            }
            o_fzp2.ॱ = f3;
            return;
        }
        throw new AssertionError();
    }

    public void ˊ(fzb o_fzb, float f) {
        o_fzb.ॱ = 0.0f;
        o_fzb.ˏ.ˊ();
        o_fzb.ˎ = 0.0f;
    }

    public fzg ˏ() {
        fzg o_fza = new fza();
        o_fza.ˊ(this.ˏ, this.ˎ);
        o_fza.ˋ.ॱ(this.ˋ);
        o_fza.ॱ.ॱ(this.ॱ);
        o_fza.ˊ = this.ˊ;
        o_fza.ʻ = this.ʻ;
        return o_fza;
    }

    public void ˊ(fzp[] o_fzpArr, int i) {
        if (!ॱॱ && (this.ˏ != null || this.ˎ != 0)) {
            throw new AssertionError();
        } else if (ॱॱ || i >= 2) {
            int i2;
            this.ˎ = i;
            this.ˏ = new fzp[this.ˎ];
            for (i2 = 1; i2 < this.ˎ; i2++) {
                if (fzm.ˎ(o_fzpArr[i2 - 1], o_fzpArr[i2]) < fzo.ॱˊ * fzo.ॱˊ) {
                    throw new RuntimeException("Vertices of chain shape are too close together");
                }
            }
            for (i2 = 0; i2 < this.ˎ; i2++) {
                this.ˏ[i2] = new fzp(o_fzpArr[i2]);
            }
            this.ˊ = false;
            this.ʻ = false;
            this.ˋ.ˊ();
            this.ॱ.ˊ();
        } else {
            throw new AssertionError();
        }
    }
}
